﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

public partial class admin_Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (!IsPostBack)
        {
            if (Request.QueryString["act"] == "logout")
            {
                Session["username"] = null;
                Session["userid"] = null;
                Session["userpower"] = null;
            }
        }
    }

    public string HostOS
    {
        get { return Environment.OSVersion.ToString(); }
    }

    public string ServerSoft
    {
        get { return Request.ServerVariables["SERVER_SOFTWARE"]; }
    }

    public string ServerName
    {
        get { return Server.MachineName; }
    }

    public string DotVersion
    {
        get { return ".NET CLR " + Environment.Version.ToString(); }
    }

    public string ScriptTimeOut
    {
        get { return Server.ScriptTimeout.ToString(); }
    }

    public string ServerLong
    {
        get { return ((Double)System.Environment.TickCount / 3600000).ToString("N2"); }
    }

    public string ServerCache
    {
        get { return Cache.Count.ToString(); }
    }

    public string Memory
    {
        get { return GetAspNetN(); }
    }

    public string CPUCount
    {
        get { return Environment.GetEnvironmentVariable("NUMBER_OF_PROCESSORS"); }
    }

    private string GetAspNetN()
    {
        string temp;
        try
        {
            temp = ((Double)System.Diagnostics.Process.GetCurrentProcess().WorkingSet64 / 1048576).ToString("N2") + "M";
        }
        catch
        {
            temp = "未知";
        }
        return temp;
    }
}